<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>线上测试网页</title>
		<script src="./rem/rem.js"></script>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}

			.btnbox {
				width: 100%;
				display: flex;
			}

			.btnbox div {
				flex: 1;
				text-align: center;
				border: 1px solid #ccc;
				line-height: 1rem;
				font-size: 0.4rem;
			}

			#result2,
			#xingwei {
				font-size: 0.4rem;
				padding: 0.4rem;
			}

			input,
			button {
				line-height: 0.7rem;
			}

			#xingwei span:nth-last-child(1) {
				color: green;
			}

			.yingd {
				padding: 0.1rem;
				background-color: #ccc;
				overflow-x: scroll;
			}
			 .btn{
				text-align: center;
				/* width: 100%; */
				padding: 10px;
				/* line-height: 40px; */
				text-align: center;
				background: #D7000A;
				color: #fff;
				border-radius: 5px;
			}
			.uni-container{
				background:rgba(0, 0, 0, 0.1);
			}
			.rizhi{
				padding: 20px;
			} 
			#putongxianshi{
				font-size: 0.4rem;
			}
		</style>
	</head>
	<body>
		<div class="btnbox">
			<div id="xhrshend">
				发送请求13次
			</div>
			<div id="tojijin">
				request 13次请求
			</div>
			<!-- <div id="tojijin2">
				跳转基金
			</div> -->
		</div>
		<div class="btnbox">
			<div id="yuans">
				跳转到基金详情
			</div>
		</div>
		<!-- <div class="btnbox">
			<input type="number" name="" id="input" style="flex: 1;" placeholder="请输入并发数量"><button style="width: 2rem;"
				id="btn">加载</button>
		</div> -->
		<div id="putongxianshi">

		</div>
		<div id="result2">
		
		</div>
		<!-- uni 的 SDK -->
		<script type="text/javascript" src="https://unpkg.com/@dcloudio/uni-webview-js@0.0.1/index.js"></script>
        <script type="text/javascript" src="https://appx/web-view.min.js"></script>
		<!-- 微信 JS-SDK 如果不需要兼容小程序，则无需引用此 JS 文件。 -->  
		<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>  
		<!-- uni 的 SDK，必须引用。 -->  
		<script type="text/javascript" src="//js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.0.1.52.js"></script>
		<script src="./jquery-1.11.3.min.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/jquery-1.11.3.min.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/vue/vue.min.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/vue/vue-tap.min.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/vant/vant@2.12.min.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/c/TZT.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/c_modules/sea.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/common/js/seajs-css.min.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/iscroll/iscroll-probe.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/lodash/lodash.min.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/native/native_bridge.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/recordWithLabel/recordWithLabel.js"></script>
		<script type="text/javascript" src="http://123.103.83.18:17777/z_modules/polyfill.min.js"></script>
		<script>
             if (navigator.userAgent.indexOf('AlipayClient') > -1 || navigator.userAgent.indexOf('mPaaSClient') > -1) {
                 document.writeln('<script src="https://appx/web-view.min.js"' + '>' + '<' + '/' + 'script>');
             }
             my.getEnv(function(res){
                console.log(res.miniprogram); //true
            });
            console.log(my)

					// 回退页面调用函数
					window.GoBackOnLoad = function(){
						console.log('回退页面调用函数')
					}
					// 页面失去焦点
					window.onDisappear = function(){
						console.log('页面失去焦点')
					}
					// 页面得到焦点
					window.onAppear = function(){
						console.log('页面得到焦点')
					}

					window.onSaveTradeSettings = function(){
						console.log('onSaveTradeSettings')
					}
					// 页面从遮挡状态恢复为显示状态
					window.onReshow = function(){
						console.log('页面从遮挡状态恢复为显示状态')
					}
					var index = -1
					var xhrshend = document.querySelector('#xhrshend')
					var tojijin = document.querySelector('#tojijin')
					var result2 = document.querySelector('#result2')
		            window.onAppear = function () {
		                index++
		                // 页面可视
		                result2.innerHTML+="<div class='child'>触发事件：onAppear</div>"
		            };
					var indexa = 0
					yuans.onclick = function(){
						// console.log('ok')
						// var u = navigator.userAgent;
						// var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
						// if (isAndroid) {
						// 	T.fn.changeURL("http://action:58300/?url=http://action:");
						// } else {
						// 	T.fn.changeURL("http://action:58300/?url=http://action:");
						// }
                        my.navigateTo({url: '../get-user-info/get-user-info'});
                       
					}
					my.onMessage = function(e) {
						console.log(e); //{'sendToWebView': '1'}
					}
					tojijin.onclick = function(){
						   for(var i=0;i<13;i++){
						       getdatauni(i)
						   }
					}
					function getdatauni(index){
					my.postMessage({name:"测试 web-view"});
					}
		            window.onDisappear = function () {
		                index++
		                // 页面消失
		                result2.innerHTML+="<div class='child'>触发事件：onDisappear</div>"
		            };
		            var putnum = 0
		            // btn.onclick = function(){
		            //     var val = input.value
		            //     if(val == ''){
		            //         alert('输入次数')
		            //     }else{
		            //         var num = Number(val)
		            //         for(var i=0;i<num;i++){
		            //             putongDom()
		            //         }
		            //     }
		            //     }
		            xhrshend.onclick = function(){
		                var www = parseInt(Math.random()*999+100)
		                for(var i=0;i<13;i++){
		                    putongDom()
		                }
		            }
		            function putongDom(){
		                putnum++
		                // var dom = document.createElement('div')
		                // var domChild = document.createElement('span')
		                // dom.innerHTML = '发送请求'+putnum+';<br/>'
		                // dom.className = 'child'
		                // result2.appendChild(dom)
		                // putongxianshi.innerHTML = '普通：'+putnum+'条'  
		                index++
		                getdata(putnum)
		            }
					
		            function getdata(index){
		                var putnum = index
		                var time = new Date
		                $.ajax({
		                    url:'http://123.103.83.56:8000/api/v3/account/get?sysNo=CS118&token=eyJjaWQiOiJDU18yYmM4MDZiMTczIiwiZERhdGUiOiIxNjY2NTk3ODU1NTMyIiwia2V5dCI6IjE2%250ANjAxODE4NjI1OTQiLCJ0b2tlbiI6ImJhNDM4ZTFlMWEwYWI4YWU4OTFhMjZkYTczNzhjNDZiZjcz%250AMzg4MDUiLCJ0b2tlbkhlYWQiOiJMVDAwMTAiLCJ0b2tlbklkIjoiRkVXN1pNQzFXNDlFNFU0UDdR%250AWjAifQ%253D%253D&_=1668421690842',
		                    type:'get',
		                    success:function(data){
								var time1 = new Date
								var str=`
								<div style="margin-bottom:10px">
									<p>请求 ${putnum}; time ${time1.getTime()-time.getTime()} s</p>
									<p>内容：成功</p>
									<p style="max-height: 80px;background: rgba(0, 0, 0, 0.1);word-break: break-all;white-space: pre-wrap;overflow-y: scroll;">${JSON.stringify(data)}</p>
								</div>
								`
								putongxianshi.innerHTML+=str
							},
		                    error:function(err){
								var time1 = new Date
								var str=`
								<div style="margin-bottom:10px">
									<p>请求 ${putnum}; time ${time1.getTime()-time.getTime()} s</p>
									<p>内容：失败</p>
									<p style="max-height: 80px;background: rgba(0, 0, 0, 0.1);word-break: break-all;white-space: pre-wrap;overflow-y: scroll;">${JSON.stringify(err)}</p>
								</div>
								`
								putongxianshi.innerHTML+=str
							}
		                })
		                // var oSendData = {
		                //     action: 48300,
		                //     method:'post',
		                //     ReqlinkType:2,
		                //     data:'{"stackMsg":"test"}'
		                //     // encodeURIComponent(JSON.stringify({"stackMsg":"test"}))
		                //     };
		                //     // var href = location.port!=''?'http://'+www+'xxx.citicsweb.com:'+location.port+'/reqxml':'http://'+www+'.localhost/reqxml'
		                //     $.getData({
		                //     oSendData: oSendData,
		                //     isload: false,
		                //     //是否通用loading动画
		                //     isToken: false,
		                //     //是否需要登录
		                //     fnSuccess: function fnSuccess(oSend){
		                //         var timeEnd = new Date
		                //         //  child[index].innerHTML += '耗时：'+(timeEnd.getTime()-time.getTime())+'ms;<br/>应答:'+JSON.stringify(oSend)
		                //         // dom.appendChild(domChild)
		                //         var child = result2.querySelectorAll('.child')
		                //         result2.innerHTML += '请求'+putnum+'应答：<div class="yingd">time：'+(timeEnd.getTime()-time.getTime())+'ms<br/>data:'+JSON.stringify(oSend)+'</div>'
		                //         console.log(child[index])
		                //     },
		                //     oConfig: function oConfig(err) {
		                //         var timeEnd = new Date
		                //         var child = result2.querySelectorAll('.child')
		                //         console.log(child[index])
		                //         result2.innerHTML += '请求'+putnum+'应答：<div class="yingd">time：'+(timeEnd.getTime()-time.getTime())+'ms<br/>data:'+JSON.stringify(err)+'</div>'
		                //         // dom.appendChild(domChild)
		                //     }
		                // });
		            }
		            // tojijin.onclick = function(){
		            //     result2.innerHTML += '<p>基金跳转：跳转基金详情</p>'
		            //     T.fn.action10061({
		            //         url: '/vue/fundDetails/generalDetail/html/generalDetail.html?productCode=590003',
		            //         secondtype: '99',
		            //         secondtext: '分享',
		            //         secondjsfuncname: 'jiJinXiangQingShare()'
		            //     });
		            // }
		            // tojijin2.onclick = function(){
		            //     result2.innerHTML += '<p>基金跳转：跳转基金</p>'
		            //     T.fn.action10061('/newzt/ceshidemo/jiJinIndex/html/jiJinIndex.html');
		            // }
		</script>
	</body>
	<script src="./vconsole.min.js"></script>
	<script>
		var vConsole = new VConsole();
	</script>
</html>
